package com.ruoyi.project.mahjong.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mahjong.mapper.TRechargeMoneyMapper;
import com.ruoyi.project.mahjong.domain.TRechargeMoney;
import com.ruoyi.project.mahjong.service.ITRechargeMoneyService;

/**
 * 充值赠送点数Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-10
 */
@Service
public class TRechargeMoneyServiceImpl implements ITRechargeMoneyService
{
    @Autowired
    private TRechargeMoneyMapper tRechargeMoneyMapper;

    /**
     * 查询充值赠送点数
     *
     * @param id 充值赠送点数ID
     * @return 充值赠送点数
     */
    @Override
    public TRechargeMoney selectTRechargeMoneyById(Long id)
    {
        return tRechargeMoneyMapper.selectTRechargeMoneyById(id);
    }

    /**
     * 查询充值赠送点数列表
     *
     * @param tRechargeMoney 充值赠送点数
     * @return 充值赠送点数
     */
    @Override
    public List<TRechargeMoney> selectTRechargeMoneyList(TRechargeMoney tRechargeMoney)
    {
        return tRechargeMoneyMapper.selectTRechargeMoneyList(tRechargeMoney);
    }

    /**
     * 新增充值赠送点数
     *
     * @param tRechargeMoney 充值赠送点数
     * @return 结果
     */
    @Override
    public int insertTRechargeMoney(TRechargeMoney tRechargeMoney)
    {
        tRechargeMoney.setCreateTime(DateUtils.getNowDate());
        return tRechargeMoneyMapper.insertTRechargeMoney(tRechargeMoney);
    }

    /**
     * 修改充值赠送点数
     *
     * @param tRechargeMoney 充值赠送点数
     * @return 结果
     */
    @Override
    public int updateTRechargeMoney(TRechargeMoney tRechargeMoney)
    {
        tRechargeMoney.setUpdateTime(DateUtils.getNowDate());
        return tRechargeMoneyMapper.updateTRechargeMoney(tRechargeMoney);
    }

    /**
     * 批量删除充值赠送点数
     *
     * @param ids 需要删除的充值赠送点数ID
     * @return 结果
     */
    @Override
    public int deleteTRechargeMoneyByIds(Long[] ids)
    {
        return tRechargeMoneyMapper.deleteTRechargeMoneyByIds(ids);
    }

    /**
     * 删除充值赠送点数信息
     *
     * @param id 充值赠送点数ID
     * @return 结果
     */
    @Override
    public int deleteTRechargeMoneyById(Long id)
    {
        return tRechargeMoneyMapper.deleteTRechargeMoneyById(id);
    }

    @Override
    public List<TRechargeMoney> selectKeYongTRechargeMoneyList( Long shopId) {
        return tRechargeMoneyMapper.selectKeYongTRechargeMoneyList(shopId);
    }
}
